package org.dreamwork.jasmine2.restful;

import com.google.gson.annotations.Expose;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: seth.yang
 * Date: 14-11-17
 * Time: 下午4:21
 */
public class MethodDefinition extends AbstractRestfulAPIDefinition {
    @Expose
    protected MethodType type;
    @Expose
    protected String name;

    protected boolean skipBeforeExecute = false;
/*
    @Expose
    private String className;
*/
    @Expose
    protected List<ResultFieldDefinition> result = new ArrayList<ResultFieldDefinition> ();
    @Expose
    protected List<APIParameterDefinition> parameters = new ArrayList<APIParameterDefinition> ();

//    private Class<?> clazz;

    public MethodType getType () {
        return type;
    }

/*
    void setType (MethodType type) {
        this.type = type;
    }
*/

/*
    public void setPattern (String pattern) {
        this.pattern = pattern;
    }
*/

/*
    public String getClassName () {
        return className;
    }

    void setClassName (String className) {
        this.className = className;
    }
*/

    void setDescription (String description) {
        this.description = description;
    }

/*
    public Class<?> getClassType () {
        return clazz;
    }

    void setClassType (Class<?> clazz) {
        this.clazz = clazz;
    }
*/

    public List<ResultFieldDefinition> getResultDefinition () {
        return result;
    }

    void addResultField (ResultFieldDefinition field) {
        result.add (field);
    }

    public String getName () {
        return name;
    }

    public void setName (String name) {
        this.name = name;
    }

    void addParameter (APIParameterDefinition parameter) {
        parameters.add (parameter);
    }

    public List<APIParameterDefinition> getParameters () {
        return this.parameters;
    }
}